//
// Created by baigui on 21-7-4.
//

#ifndef SIMPLE_PLAYER_NDKDECODER_H
#define SIMPLE_PLAYER_NDKDECODER_H

#include "VideoRender.h"
#include "VideoDecoder.h"

class NDKDecoder : public VideoDecoder {
public:
    NDKDecoder(weak_ptr<MediaPlayer> player);
    ~NDKDecoder();

    bool Open(void* codec) override;

    void requestPicture() override;
    void QueueBuffer(block_t *p) override ;

    void handle(int , void *) override ;
    bool start()override;

protected:
    AMediaCodec *NDK_codec;

    shared_ptr<Looper> mOutLooper;

    int renderstart = -1;

    int *a = new int[1];
};


#endif //SIMPLE_PLAYER_NDKDECODER_H
